<?php

/*

  Action	$2 + 1 potion

  +2 Actions
  You may gain an Action card costing up to $5.

 */

class University extends Card implements iAction, iKingdom, iAlchemy {

    public function __construct() {
        $price = new Price(2, 1);
        parent::__construct("University", $price);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+2 Actions",
            "You may gain an Action card costing up to $5.");
    }
    public function play(Game $game, $isRealCard) {
        $game->addActions(2);
        ScreenDisplay::addScreenMessage($game, true, "get +2 actions  ", "gets +2 actions ");
        
        $optional_cards = $game->getBoardActionCardsByPrice(0, 5);
        if (sizeof($optional_cards) > 0) {
            
            $output = MySocket::GetUserReply($game,  Input_ChooseOne,  $optional_cards, 1, 1, null, "Choose an action to gain");
            $card_name = $output[0];
            $new_card = $game->moveCardFromPileToPile($card_name, BoardCards, DiscardPile);
              ScreenDisplay::addScreenMessage($game, false, " and gain  ".  nicePrint($new_card), " and gains ". ScreenDisplay::$LMSG);
        }
        $game->cardActionFinished();
        return true;
    }
    
    public function boardSetup(Game $game) {
        $game->addPotion();
        return true;
    }

}

?>